<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <include file="Public:jquery" />
        <include file="Public:dialog" />
        <include file="Public:editor" />
        <include file="Public:startapp" />
        <include file="Public:startmoo" />
        <script type="text/javascript">
            $(function(){
                $('.guestbook_reply').click(function(){
                    var reply_url = $(this).attr('href');
                    var reply_dialog = art.dialog({
                        title : '回复',
                        lock : true
                    });
                    $.ajax({
                        url : reply_url,
                        success : function (e){
                            reply_dialog.content(e);
                            KindEditor.create("#content",{
                                items:['fontname','fontsize','textcolor','bgcolor','bold','italic','underline','removeformat','justifyleft','justifycenter','justifyright','insertorderedlist','insertunorderedlist','emoticons','link']
                            });
                        },
                        cache : false
                    });
                    return false;
                });
            });
        </script>
    </head>
    <body>
        <include file="Public:header" />
        
        <div class="layout">
            
            <include file="Public:position" />
            
            <table class="warp" cellpadding="0" cellspacing="0">
                <tr>
                    <td class="sidebar" valign="top">
                        <include file="Public:sidebar" />
                    </td>
                    <td class="contents" valign="top">
                                                
                        <div class="a_table">
                        <table cellspacing="1" width="100%" class="gr_list">
	                        <tr style="background: #f0f7ff; font-weight: bold;">
	                            <td width="20" height="20"></td>
	                            <td width="60" align="center">编号</td>
	                            <td align="center">留言人</td>
	                            <td align="center">留言内容</td>
	                            <td width="100" align="center">留言时间</td>
	                            <td width="160" align="center">操作</td>
	                        </tr>
	                        <volist id="vo" name="list">
	                        <tr rel="{$vo['id']}">
	                            <td><input type="checkbox" name="list[]" value="{$vo.id}" /></td>
	                            <td align="center">{$vo['id']}</td>
	                            <td align="center">{$vo.username}</td>
	                            <td>{$vo.content}
	                                <?php
	                                    $s_list = $guestbook_model->where("pid='".$vo['id']."'")->select();
	                                    if ( !empty( $s_list ) ){
	                                    	foreach($s_list as $key => $val){
	                                ?>
	                                <dl class="reply">
	                                    <dt>{$val.username} 于 {$val.create_time|date=C('DEFAULT_DATE_FORMAT'),###} 回复 {$vo.username}</dt>
	                                    <dd>{$val.content}</dd>
	                                </dl>
	                                <?php
	                                    	}
	                                    }
	                                ?>
	                            </td>
	                            <td align="center">{$vo.create_time|date=C('DEFAULT_DATE_FORMAT'),###}</td>
	                            <td align="center">
	                                <a href="{:U('reply?id='.$vo['id'])}" class="guestbook_reply">回复</a><span class="action_line">&nbsp;&nbsp;|&nbsp;&nbsp;</span><a href="{:U('delete',array('id' => $vo['id']))}" class="del_node" rel="{$vo.id}">删除</a>
	                            </td>
	                        </tr>
	                        </volist>
	                    </table>
	                    <div class="page">{$page}</div>
                        </div>
                    </td>
                </tr>
            </table>
        </div>
        
        <include file="Public:footer" />
    </body>
</html>